﻿<?php
	
	$id_role = $_POST['id_role'];
	$type_role = $_POST['type_role'];
	$id_employMsg = $_POST['id_employMsg'];
	$comment_content = $_POST['comment_content'];

	if($id_role != null && $id_employMsg != null && $type_role != null)//这三个参数一定不能为空
	{
		include('../class/filter.class.php');
		include('../class/messageBoard.class.php');
		//echo json_encode(array('status'=>1,'html'=>"123"));
		//过滤下字符串
		echo '<script>alert("'.$id_role.','.$type_role.','.$id_employMsg.','.$comment_content.'");</script>';//json_encode(array('status'=>1,'html'=>$id_role.','.$type_role.','.$id_employMsg.','.$comment_content));
		$class_filter = new Filter();
		$conment_content = $class_filter->Filter_Input($conmment_content);
		//像数据库插入记录
		
		$class_msgBoard = new MessageBoard();
		//执行插入操作，并且获取新增记录的id
		$id_comment = $class_msgBoard->AddMessage($id_employMsg,$id_role,$type_role,$comment_content);
		echo json_encode(array('status'=>1,'html'=>($class_msgBoard->ShowOneCommentById($id_comment))));
		//
	}
	else
	{
		echo json_encode(array('status'=>0,'html'=>''));
	}
	
	/*$id_role = $_POST['id_role'];
	$type_role = $_POST['type_role'];
	$id_employMsg = $_POST['id_employMsg'];
	$comment_content = $_POST['comment_content'];
	echo '<script>alert("'.$id_role.','.$type_role.','.$id_employMsg.','.$comment_content.'");</script>';
	if($id_role != null && $id_employMsg != null && $type_role != null)//这三个参数一定不能为空
	{
		include('../class/filter.class.php');
		include('../class/messageBoard.class.php');
		//过滤下字符串
		$class_filter = new Filter();
		$conment_content = $class_filter->Filter_Input($conmment_content);
		//像数据库插入记录
		$class_msgBoard = new MessageBoard();
		//执行插入操作，并且获取新增记录的id
		$id_comment = $class_msgBoard->AddMessage($id_employMsg,$id_role,$type_role,$comment_content);
		echo json_encode(array('status'=>1,'html'=>$class_msgBoard->ShowOneCommentById($id_comment)));
	}
	else
	{
		echo json_encode(array('status'=>0,'html'=>''));
	}*/
?>